﻿using System;
using System.Web.Script.Serialization;
using IPCChannel;

namespace UProveAPI
{
    public enum PresentationDataType
    {
        PresentToken,
        TokenVerification,
    }

    [Serializable]
    public class PresentationMessage : IPCMessage
    {
        public PresentationDataType DataType;
        public string SerializedToken;
        public string PresentationProof;
        public int[] DisclosedIndices;
        public int[] Committed;
        public byte[] Message;
        public byte[] Scope;
        public bool Verified;

        public PresentationMessage()
            : base(IPCMessageTypes.PresentationMessage)
        {
        }

        public PresentationMessage(PresentationDataType dataType)
            : base(IPCMessageTypes.PresentationMessage)
        {
            DataType = dataType;
        }

        public override string Serialize()
        {
            return new JavaScriptSerializer().Serialize(this);
        }
    }
}
